package com.nuc;


import com.github.pagehelper.PageInfo;
import com.ncu.mapper.EmpMapper;
import com.ncu.pojo.Emp;
import com.ncu.service.EmpService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:applicationContext.xml"})
public class test1 {


    @Autowired
    private EmpService empService;
    @Autowired
    private EmpMapper empMapper;

    @Test
    public void test1(){
        PageInfo<Emp> page = empService.findAllDept(1);
        System.out.println(page);
        List<Emp> list = page.getList();
        for (Emp emp : list) {
            System.out.println(emp);
        }

    }

    @Test
    public void test2(){
        List<Emp> allDept = empMapper.findAllDept();
        System.out.println(allDept);
    }
}
